Skip to content

Conversation

@copybara-service
Copy link

Fix Espresso.onIdle for non-main Loopers on Baklava.

LooperIdlingResourceInterrogationHandler, which is used for non main Loopers,
requires calling peekAtQueueState from the main Looper thread. The previous Interrogator implementation,
when used on Baklava, didn't effectively support this because TestLooperManager.acquire
needs to be called from the Looper's thread.

This commit refactors Interrogator so it be acquired and stored on the Looper's current thread.

LooperIdlingResourceInterrogationHandler, which is used for non main Loopers,
requires calling peekAtQueueState from the main Looper thread. The previous Interrogator implementation,
when used on Baklava, didn't effectively support this because TestLooperManager.acquire
needs to be called from the Looper's thread.

This commit refactors Interrogator so it be acquired and stored on the Looper's current thread.

PiperOrigin-RevId: 714149090
@copybara-service copybara-service bot merged commit 8091cbd into main Jan 10, 2025
@copybara-service copybara-service bot deleted the piper_713791142 branch January 10, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant